package chapter4.No4_1_使用reentrantLock类.demo13;

/**
 * hasWaiters(Condition condition)：
 *    查询是否有线程正在等待此锁定有关的condition
 *    简单的说：就是condition有没有线程处于awaiting状态
 * Created by Administrator on 2016/11/22.
 */
public class Main2 {

    public static void main(String[] args) throws InterruptedException {
        final ServiceClass2 sc = new ServiceClass2();
        Runnable runnable = new Runnable() {
            public void run() {
                sc.await();
            }
        };
        for(int i = 0; i < 10; i++) {
            new Thread(runnable).start();
        }
        Thread.sleep(500);

        sc.signal();

    }
}
